1. Field of the Invention
The invention relates to a method for controlling power supply of a computer system, and more particularly, to a method for providing power through an interface of the computer system when the computer system is operating under a sleep mode or a power off mode.
2. Description of the Prior Art
As technology advances, portable electronic devices such as cellular phones, digital cameras, and MP3 players are able to achieve tasks such as battery charging and data exchange by connecting to an interface (i.e. USB or IEEE 1394) of a computer system. However, due to the fact that the computer system only expends very little electrical power, or even no power at all to the output interface while the system is operating under a sleep mode or a power off mode, the aforementioned tasks can only be accomplished while the computer system is turned on.
The aforementioned sleep mode refers to a state similar to a power off condition of a computer system, in which the sleep mode typically involves a Suspend To Ram mode or a Suspend To Disk mode defined by the Advanced Configuration & Power Interface. The Advanced Configuration & Power Interface is a standard governed by Microsoft Corporation, Intel Corporation, and Toshiba Corporation, in which the standard establishes a power management program that assigns the task of power management to an operating system. The Advanced Configuration & Power Interface standard divides categories including operating system, hardware environment, and power consumption into four modes, including global mode, device mode, sleeping mode, and CPU mode. The sleep mode can be subcategorized into five modes:    1. S1 Mode: An Idle mode. Under this mode, the system is able to return to the normal operating condition quickly and no data are lost. Additionally, the output screen signal is turned off, and the operation of hard-drive is stopped. However, all interfaces are supplied with power.    2. S2 Mode: A mode similar to the S1 mode. However, data between CPU and cache memory is lost under this mode, and has to be maintained after the system recovers.    3. S3 Mode: A Suspend To Ram mode. All data, except the memory data are lost under this mode, in which the data stored in the memory is maintained by the hardware while power is still supplied to the memory. After entering this mode, all data stored in the memory are stayed intact, and a false power off conditioned is initiated. Under the false power off condition, power is only supplied to the memory, whereas power supplying to other equipments, devices, and interfaces is stopped. After rebooting, computer will verify the data stored in the memory and return back to a screen appeared before S3 mode was entered.    4. S4 Mode: A Suspend To Disk mode. Lowest power consumption is achieved under this mode. Since all devices are shut down under this mode, a longer recovering time is required to return back to a normal mode. After entering this mode, all data stored in the memory of the operating system are stored in the hard drive, and power supplying to all equipments, devices, interfaces, and memories is stopped. All stored data are read to memories after the computer reboots.    5. S5 mode: A mode equivalent to a software power off mode. Power consumption is low under this mode, and no maintenance is done by the operating system. Tasks can be carried out after the computer reboots.
If the computer system is operating under S3, S4, or S5 mode, users are unable to charge a portable electronic device through a transmission port of an interface since no power is being supplied under these modes. In other words, if a computer system were to be used to charge a portable electronic device, the computer system must be turned on first. Even if a user wishes to charge the portable electronic device through a USB interface, the computer system still has to be turned on. Consequently, power waste will commonly result for the desktop computers. Power consumption is wasted in similar means for portable computers utilizing batteries. In the conventional art, even if a user wishes to use the USB interface of a portable computer to charge a cellular phone without using other functions of the portable computer, the computer still has to be turned on to achieve the task. The result not only wastes power but also significantly reduces the usage time of the portable computer.